<?php get_header(); ?>
<?php
	$category_id = get_query_var('cat');
	$cat_name = get_category(get_query_var('cat'))->name;
	$category_slug = get_category(get_query_var('cat'))->slug;
	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$wp_query = new WP_Query(
	     array('cat' => $category_id, 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged)
	);
?>


<div class="content-area">
	<div class="container">
	
		<?php get_template_part("template-parts/page-title");?>
			
		<?php
			$description = term_description();
         		if ( $description )
				printf( '<div class="archive-meta">%s</div>', $description );
		?>
		
		<?php //start loop
			if ( $wp_query->have_posts() ) {
				echo '<div class="page-content">';
				
				echo '<div class="articles-wrapper"><div class="row">';
				 while ( $wp_query->have_posts() ) : $wp_query->the_post(); // run the loop
				get_template_part( 'template-parts/category/category', $category_slug);
				endwhile;
				echo '</div></div>';
				
				if ( $wp_query->max_num_pages > 1 ) :
					require( 'pagination.php');
				endif;
				
				echo '</div>';
			}// end loop
			wp_reset_query();
		?>
		
	</div>
</div>
	
<?php get_footer(); ?>